package com.molichuxing.services.infrastructure.service;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.service.RootService;
import com.molichuxing.services.infrastructure.dto.request.create.OrderRenegeCreateDto;
import com.molichuxing.services.infrastructure.dto.request.modify.OrderRenegeCostModifyDto;
import com.molichuxing.services.infrastructure.dto.request.modify.OrderRenegePayeeModifyDto;
import com.molichuxing.services.infrastructure.dto.response.OrderNegotiateRenegeDto;
import com.molichuxing.services.infrastructure.dto.response.OrderRenegeDto;
import com.molichuxing.services.property.OrderRenegeStatusEnum;
import com.molichuxing.services.property.OrderRenegeTypeEnum;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 订单退租service
 *
 * @author zoumingyu
 * @date 2020年2月26日
 */
public interface OrderRenegeService extends RootService {

    /**
     * 订单退租新增
     *
     * @param createDto
     * @return
     */
    public Boolean create(OrderRenegeCreateDto createDto);

    /**
     * 查询退租信息
     *
     * @param orderCode    订单号
     * @param renegeStatus 退租状态
     * @return
     */
    public OrderRenegeDto getRenege(Long orderCode, OrderRenegeStatusEnum renegeStatus);

    /**
     * 查询有效退租信息
     *
     * @param orderCode 订单号
     * @return
     */
    public OrderRenegeDto getEffectiveRenege(Long orderCode);

    /**
     * 查询有效退租信息
     *
     * @param renegeTimeStart 退租时间-开始
     * @param renegeTimeEnd   退租时间-结束
     * @return
     */
    public List<OrderRenegeDto> getEffectiveRenegeList(LocalDateTime renegeTimeStart, LocalDateTime renegeTimeEnd);

    /**
     * 订单退租取消
     *
     * @param orderCode 订单号
     * @return
     */
    public Boolean modifyCancel(Long orderCode);

    /**
     * 订单退租费用修改
     *
     * @param modifyDto
     * @return
     */
    public Boolean modifyCost(OrderRenegeCostModifyDto modifyDto);

    /**
     * 订单退租费用修改
     *
     * @param modifyDto
     * @return
     */
    public Boolean modifyPayee(OrderRenegePayeeModifyDto modifyDto);

    /**
     * 订单退租完成
     *
     * @param orderCode 订单号
     * @return
     */
    public Boolean modifyComplete(Long orderCode);

    /**
     * 协商退租总数
     *
     * @param renegeType 退租类型
     * @return
     */
    int getRenegeTotal(OrderRenegeTypeEnum renegeType);

    /**
     * 查询协商退租列表
     *
     * @param params   查询参数
     * @param pageNum  页数
     * @param pageSize 每页条数
     * @return Paged
     */
    Paged<OrderNegotiateRenegeDto> getNegotiateRenegePaged(Map<String, Object> params, int pageNum, int pageSize);

    /**
     * 订单诉讼
     *
     * @param orderCode 订单号
     * @return
     */
    Boolean modifyLawsuit(Long orderCode);

    Boolean modifyOverdue(Long orderCode, Integer overdueDaysTotal, Integer overdueNumTotal);

}
